﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
using S3.Properties;

namespace S3.Common
{
    #region Action Enum

    public enum ActionType
    {
        StartMachine,
        StopMachine,
        AddService,
        ChangeDesk,
        ChangeType,
        ChangeService,
        ChangeMachineQuantity,
        ChangeBlock
    }

    #endregion

    public class Constants
    {
        #region Common object
        public static string StaffName = "System";
        public static string RegistryLisenceName = "S3LisenceName";
        public static string RegistryLisenceKey = "S3LisenceKey";
        public static string RegistryLisenceExpire = "S3LisenceExpire";
        public const string MainFormTitle = "S3";

        #endregion

        #region Setting keys
        
        //Print
        public static string PrintFilePrintMe = Properties.Settings.Default.PrintFilePrintMe;
        public static string PrintFileTemplate = Properties.Settings.Default.PrintFileTemplate;
        public static string PrintRowHtmlFormat = Properties.Settings.Default.PrintRowHtmlFormat;
        public static string PrintDataToPrint = Properties.Settings.Default.PrintDataToPrint;
        public static string PrintCustNo = Properties.Settings.Default.PrintCustNo;
        public static string PrintInvoiceNo = Properties.Settings.Default.PrintInvoiceNo;
        public static string PrintTotalMoney = Properties.Settings.Default.PrintTotalMoney;
        public static string PrintDiscount = Properties.Settings.Default.PrintDiscount;
        public static string PrintDeskName = Properties.Settings.Default.PrintDeskName;
        public static string PrintEndTime = Properties.Settings.Default.PrintEndTime;
        public static string PrintStartTime = Properties.Settings.Default.PrintStartTime;
        public static string PrintPaid = Properties.Settings.Default.PrintPaid;
        
        public static string KindOfMachines = Properties.Settings.Default.KindOfMachines;
        public static int NumberOfMoneyAccuracy = Settings.Default.NumberOfMoneyAccuracy;// Convert.ToInt32(ConfigurationManager.AppSettings["NumberOfMoneyAccuracy"]);
        public static int DeskIconWidth = Settings.Default.DeskIconWidth;// Convert.ToInt32(ConfigurationManager.AppSettings["DeskIconWidth"]);
        public static int DeskIconHeight = Settings.Default.DeskIconHeight;// Convert.ToInt32(ConfigurationManager.AppSettings["DeskIconHeight"]);
        #endregion

        #region Format
        
        public static string Format_Hour_Minute = Settings.Default.Format_Hour_Minute;// "{0:HH:mm}";
        public static string Format_Day_Month = Settings.Default.Format_Day_Month;// "{0:dd/MM}";
        public static string Format_Date_Time = Settings.Default.Format_Date_Time;// "{0:HH:mm dd/MM/yyyy}";
        public static string Format_DateTime_Hour = Settings.Default.Format_DateTime_Hour;// "dd/MM/yyyy HH:mm";
        public static string Format_Used_Time = Settings.Default.Format_Used_Time;// "{0} giờ {1} phút";
        #endregion

        #region Config key
        
        #endregion

        #region Notes Messages
        //Timing Service Notes
        public static string MsgTimingServiceChangeType = Settings.Default.MsgTimingServiceChangeType;
        public static string MsgTimingServiceUsedServices = Settings.Default.MsgTimingServiceUsedServices;
        public static string MsgTimingServiceReceivedMoney = Settings.Default.MsgTimingServiceReceivedMoney;
        public static string MsgTimingServiceTransferedMoney = Settings.Default.MsgTimingServiceTransferedMoney;
        public static string MsgTimingServiceChangeDesk = Settings.Default.MsgTimingServiceChangeDesk;

        //Goods Notes
        public static string MsgAddedGoodsQuantity = Settings.Default.MsgAddedGoodsQuantity;
        public static string MsgSubtractGoodsQuantity = Settings.Default.MsgSubtractGoodsQuantity;

        
        #endregion        
    }


    #region MainContextMenu
    public class MainContextMenuValue
    {
        public static Dictionary<MainFormContextMenu, string> Text = new Dictionary<MainFormContextMenu, string>()
        {
            {MainFormContextMenu.Start, ConfigurationManager.AppSettings["ContextMenu.Start"]},
            {MainFormContextMenu.Switch,ConfigurationManager.AppSettings["ContextMenu.Switch"]},
            {MainFormContextMenu.End,ConfigurationManager.AppSettings["ContextMenu.End"]},
        };

    }

    public enum MainFormContextMenu
    {
        Start,
        Switch,
        End
    }

    #endregion

    #region WorkSessionStatus
    public class WorkSessionStatusValue
    {
        public static Dictionary<WorkSessionStatus, string> Text = new Dictionary<WorkSessionStatus, string>()
        {
            {WorkSessionStatus.Waiting,Properties.Settings.Default.WorkSessionStatusWaiting},
            {WorkSessionStatus.Done,Properties.Settings.Default.WorkSessionStatusDone}
        };

    }

    public enum WorkSessionStatus
    {
        Waiting,
        Done
    }

    #endregion

    #region DeskStatusValue
    public class DeskStatusValue
    {
        public static Dictionary<DeskStatus, string> Text = new Dictionary<DeskStatus, string>()
        {
            {DeskStatus.Avaiable,ConfigurationManager.AppSettings["DeskStatus.Avaiable"]},
            {DeskStatus.NotUse,ConfigurationManager.AppSettings["DeskStatus.NotUse"]}
        };

    }

    public enum DeskStatus
    {
        Avaiable,
        NotUse
    }

    #endregion

    #region DailyAddditonalItemEntryValue
    public class DailyAddditonalItemEntryStatusValue
    {
        public static Dictionary<AdditonalItemEntryStatus, string> Text = new Dictionary<AdditonalItemEntryStatus, string>()
        {
            {AdditonalItemEntryStatus.Paid,ConfigurationManager.AppSettings["AdditonalItemEntryStatus.Paid"]},
            {AdditonalItemEntryStatus.UnPaid,ConfigurationManager.AppSettings["AdditonalItemEntryStatus.NotPaid"]}
        };

    }

    public enum AdditonalItemEntryStatus
    {
        Paid,
        UnPaid
    }

    #endregion

    #region AdditionalItemStatusValue
    public class ItemStatusValue
    {
        public static Dictionary<ItemStatus, string> Text = new Dictionary<ItemStatus, string>()
        {
            {ItemStatus.Avaiable,Settings.Default.ItemStatusAvaiable},
            {ItemStatus.Empty,Settings.Default.ItemStatusEmpty},
            {ItemStatus.Pending,Settings.Default.ItemStatusPending},
            {ItemStatus.WaitingForImport,Settings.Default.ItemStatusWaitingForImport},
            {ItemStatus.ErrorItem,Settings.Default.ItemStatusErrorItem},
            {ItemStatus.Expired,Settings.Default.ItemStatusExpired},
            {ItemStatus.MissingComponents,Settings.Default.ItemStatusMissingComponents},
        };

    }

    public enum ItemStatus
    {
        Avaiable,//San hang
        Empty,//het hang
        Pending,//tam ngung ban hang
        WaitingForImport,//cho nhap hang
        ErrorItem,// hang loi
        Expired,//het han su dung
        MissingComponents//thieu linh kien
    }

    #endregion

    #region DailyEntryStatusValue
    public class DailyEntryStatusValue
    {
        public static Dictionary<DailyEntryStatus, string> Text = new Dictionary<DailyEntryStatus, string>()
        {
            {DailyEntryStatus.Playing,ConfigurationManager.AppSettings["DailyEntryStatus.Playing"]},
            {DailyEntryStatus.Finished,ConfigurationManager.AppSettings["DailyEntryStatus.Finished"]},
            {DailyEntryStatus.Switched,ConfigurationManager.AppSettings["DailyEntryStatus.Switched"]},
        };

    }

    public enum DailyEntryStatus
    {
        Playing,
        Finished,
        Switched
    }

    #endregion

    #region TimeBlockUnitPrice
    public class TimeBlockUnitPriceStatusValue
    {
        public static Dictionary<TimeBlockUnitPriceStatus, string> Text = new Dictionary<TimeBlockUnitPriceStatus, string>()
        {
            {TimeBlockUnitPriceStatus.Avaiable,ConfigurationManager.AppSettings["TimeBlockUnitPriceStatus.Avaiable"]},
            {TimeBlockUnitPriceStatus.NotUse,ConfigurationManager.AppSettings["TimeBlockUnitPriceStatus.NotUse"]}
        };

    }

    public enum TimeBlockUnitPriceStatus
    {
        Avaiable,
        NotUse
    }

    #endregion

    #region UserStatusValue
    public class UserStatusValue
    {
        public static Dictionary<UserStatus, string> Text = new Dictionary<UserStatus, string>()
        {
            {UserStatus.Avaiable,ConfigurationManager.AppSettings["UserStatus.Avaiable"]},
            {UserStatus.Blocked,ConfigurationManager.AppSettings["UserStatus.Blocked"]}
        };

    }

    public enum UserStatus
    {
        Avaiable,
        Blocked
    }

    #endregion

    public enum ReportType
    {
        Daily,
        Monthly
    }

    #region UserRoleValue
    public class UserRoleValue
    {
        public static Dictionary<UserRole, string> Text = new Dictionary<UserRole, string>()
        {
            {UserRole.Admin,ConfigurationManager.AppSettings["UserRole.Admin"]},
            {UserRole.Staff,ConfigurationManager.AppSettings["UserRole.Staff"]}
        };

    }

    public enum UserRole
    {
        Admin,
        Staff
    }

    #endregion

    public enum NotesType
    {
        //Timing service
        TimingServiceChangeType,
        TimingServiceUsedServices,
        TimingServiceReceivedMoney,
        TimingServiceTransferedMoney,
        TimingServiceChangeDesk,
        //Goods Notes
        AddedGoods,
        SubtractGoods
    }

}
